import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/checkInformation/list',
    method: 'get',
    params: query
  })
}

// 查询订单
export function getOrder(checkInformationId) {
  return request({
    url: '/checkInformation/' + checkInformationId,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/checkInformation',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/checkInformation',
    method: 'put',
    data: data
  })
}
// 查询支付单
export function listPayment(query) {
  return request({
    url: '/payment/list',
    method: 'get',
    params: query
  })
}
// 新增支付单
export function addPayment(data) {
  return request({
    url: '/checkInformation/confirmPayment',
    method: 'get',
    params: data
  })
}

// 查询支付单
export function getPayment(checkInformationId) {
  return request({
    url: '/checkInformation/' + checkInformationId,
    method: 'get'
  })
}
// 以前的支付订单
export function payRoom(checkInformationId) {
  return request({
    url: '/checkInformation/confirmPayment/' + checkInformationId,
    method: 'get'
  })
}
// 删除订单
export function deleteOrder(checkInformationId) {
  return request({
    url: '/checkInformation/delete/' + checkInformationId,
    method: 'delete'
  })
}
// 删除入住信息明细
export function delcheckinItem(checkInformationDetailsId) {
  return request({
    url: '/checkInformationDetails/delete/' + checkInformationDetailsId,
    method: 'delete'
  })
}
// 分页查询订单列表
export function listOrderByPage(query) {
  return request({
    url: '/checkInformation/page',
    method: 'get',
    params: query
  })
}
// 分页查询订单明细列表
export function listOrderItemByPage(query) {
  return request({
    url: '/checkInformationDetails/page',
    method: 'get',
    params: query
  })
}
